package a.e.b.a;

import a.e.b.b.b;
import a.e.b.b.j;
import a.e.b.b.t;
import a.e.b.c.cb;
import a.e.b.c.o;
import a.j.ae;
import a.j.ig;
import a.j.tb;
import a.j.zd;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import javax.swing.*;

public abstract class a
  implements w
{
  static final Object a = "y.io.graphml.graph2d.AbstractEdgeRealizerSerializer.INDIRECT_REALIZER_DESERIALIZATION";
  static final Object b = "y.io.graphml.graph2d.AbstractEdgeRealizerSerializer.CURRENT_REALIZER";
  public static boolean c;
  
  private static String a(Node paramNode, String paramString)
  {
    boolean bool = i.i;
    int j = i.h;
    NamedNodeMap localNamedNodeMap = paramNode.getAttributes();
    int i = 0;
    do
    {
      if (i >= localNamedNodeMap.getLength()) {
        break;
      }
      Node localNode = localNamedNodeMap.item(i);
      if (!bool)
      {
        if (localNode.getNodeName().equals(paramString)) {
          return localNode.getNodeValue();
        }
        i++;
      }
    } while (j == 0);
    return null;
  }
  
  public void a(tb paramtb, Node paramNode, t paramt)
    throws a.e.b.b.a
  {
    boolean bool = i.i;
    int j = i.h;
    if (!bool) {
      if ("true".equals(a(paramNode, "selected"))) {
        paramtb.c(true);
      }
    }
    if ("false".equals(a(paramNode, "visible"))) {
      paramtb.b(false);
    }
    NodeList localNodeList = paramNode.getChildNodes();
    if (localNodeList != null)
    {
      String str1 = "http://www.yworks.com/xml/graphml";
      int i = 0;
      label299:
      label304:
      label311:
      do
      {
        if (i >= localNodeList.getLength()) {
          break;
        }
        Node localNode1 = localNodeList.item(i);
        if (!bool)
        {
          if (localNode1.getNodeType() == 1)
          {
            if (bool) {
              continue;
            }
            if (str1.equals(localNode1.getNamespaceURI()))
            {
              String str2 = localNode1.getLocalName();
              if (!bool) {
                if ("Path".equals(str2)) {
                  y.a(localNode1, paramtb);
                }
              }
              if (!bool) {
                if ("EdgeLabel".equals(str2)) {
                  b(paramtb, localNode1, paramt);
                }
              }
              Object localObject;
              if (!bool) {
                if ("LineStyle".equals(str2))
                {
                  paramtb.a(y.e(localNode1));
                  localObject = localNode1.getAttributes();
                  Node localNode2 = ((NamedNodeMap)localObject).getNamedItem("hasColor");
                  if (!bool)
                  {
                    if ((localNode2 != null) && ("false".equalsIgnoreCase(localNode2.getNodeValue()))) {
                      break label299;
                    }
                    localNode2 = ((NamedNodeMap)localObject).getNamedItem("color");
                    if (bool) {}
                  }
                  else
                  {
                    if (localNode2 == null) {
                      break label304;
                    }
                    paramtb.a(y.a(localNode2.getNodeValue()));
                  }
                  if (bool) {
                    break label311;
                  }
                  if (j != 0) {
                    paramtb.a(null);
                  }
                }
              }
              if (!bool) {
                if ("Arrows".equals(str2))
                {
                  paramtb.c(y.a(localNode1, "source"));
                  paramtb.b(y.a(localNode1, "target"));
                }
              }
              if (!bool) {
                if ("SourcePort".equals(str2))
                {
                  localObject = c(localNode1, paramt);
                  if (localObject != null) {
                    paramtb.a((zd)localObject);
                  }
                }
              }
              if (bool) {
                continue;
              }
              if ("TargetPort".equals(str2))
              {
                localObject = c(localNode1, paramt);
                if (bool) {
                  continue;
                }
                if (localObject != null) {
                  paramtb.b((zd)localObject);
                }
              }
            }
          }
          i++;
        }
      } while (j == 0);
    }
  }
  
  protected void b(tb paramtb, Node paramNode, t paramt)
    throws a.e.b.b.a
  {
    j localj = new j(paramt);
    localj.a(b, paramtb);
    localj.a(paramNode);
  }
  
  protected zd c(Node paramNode, t paramt)
    throws a.e.b.b.a
  {
    boolean bool = i.i;
    int j = i.h;
    Node localNode1 = paramNode.getAttributes().getNamedItem("type");
    if ((localNode1 != null) && ("InterfacePort".equals(localNode1.getNodeValue())))
    {
      NodeList localNodeList = paramNode.getChildNodes();
      Icon localIcon = null;
      if (localNodeList != null)
      {
        String str1 = "http://www.yworks.com/xml/graphml";
        int i = 0;
        do
        {
          if (i >= localNodeList.getLength()) {
            break;
          }
          Node localNode2 = localNodeList.item(i);
          if ((!bool) && (j != 0)) {
            break label196;
          }
          if (!bool)
          {
            if (localNode2.getNodeType() == 1)
            {
              if (bool) {
                continue;
              }
              if (str1.equals(localNode2.getNamespaceURI()))
              {
                String str2 = localNode2.getLocalName();
                if (bool) {
                  continue;
                }
                if ("Icon".equals(str2)) {
                  localIcon = y.a(localNode2, "href", paramt);
                }
              }
            }
            i++;
          }
        } while (j == 0);
      }
      if ((!bool) && (localIcon != null)) {
        return new ae(localIcon);
      }
      label196:
      return null;
    }
    return null;
  }
  
  public void b(tb paramtb, cb paramcb, o paramo)
  {
    boolean bool = i.i;
    Object localObject = paramo.a("writeSelectionState");
    if (!bool)
    {
      if (Boolean.TRUE.equals(localObject)) {
        paramcb.a("selected", paramtb.P());
      }
      localObject = paramo.a("writeVisibility");
    }
    if ((bool) || ((!Boolean.FALSE.equals(localObject)) && (!paramtb.K()))) {
      paramcb.a("visible", paramtb.K());
    }
  }
  
  public void a(tb paramtb, cb paramcb, o paramo)
    throws a.e.b.c.a
  {
    boolean bool = i.i;
    int j = i.h;
    y.a(paramcb, paramtb);
    y.a(paramcb, "LineStyle", paramtb.D(), paramtb.A());
    y.a(paramcb, "Arrows", paramtb.I(), paramtb.H());
    int i = 0;
    do
    {
      if (i >= paramtb.V()) {
        break;
      }
      ig localig = paramtb.d(i);
      a(localig, paramcb, paramo);
      i++;
      if ((!bool) && (j != 0)) {
        return;
      }
    } while (j == 0);
    a(paramtb.k(), paramcb, paramo, true);
    if (!bool) {
      a(paramtb.l(), paramcb, paramo, false);
    }
  }
  
  protected void a(ig paramig, cb paramcb, o paramo)
    throws a.e.b.c.a
  {
    paramo.b(paramig);
  }
  
  protected void a(zd paramzd, cb paramcb, o paramo, boolean paramBoolean)
  {
    if ((i.i) || ((paramzd instanceof ae)))
    {
      ae localae = (ae)paramzd;
      paramcb.a(paramBoolean ? "SourcePort" : "TargetPort", "http://www.yworks.com/xml/graphml");
      paramcb.c("type", "InterfacePort");
      paramcb.a("Icon", "http://www.yworks.com/xml/graphml");
      y.a(paramcb, "href", localae.h(), paramo);
      paramcb.b();
      paramcb.b();
    }
  }
  
  public boolean a(tb paramtb, o paramo)
  {
    return paramtb.getClass() == d();
  }
  
  public boolean a(Node paramNode, t paramt)
  {
    boolean bool = i.i;
    if (((bool) || (paramNode.getNodeType() == 1)) && ((bool) || (paramNode.getNamespaceURI().equals(b())))) {
      if (bool) {}
    }
    return paramNode.getLocalName().equals(a());
  }
  
  public tb b(Node paramNode, t paramt)
    throws a.e.b.b.a
  {
    try
    {
      return (tb)d().newInstance();
    }
    catch (InstantiationException localInstantiationException)
    {
      throw new b("Unable to create instance of class" + d() + ": " + localInstantiationException.getMessage(), localInstantiationException);
    }
    catch (IllegalAccessException localIllegalAccessException)
    {
      throw new b("Unable to create instance of class" + d() + ": " + localIllegalAccessException.getMessage(), localIllegalAccessException);
    }
  }
  
  public String c()
  {
    return null;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.e.b.a.a

 * JD-Core Version:    0.7.0.1

 */